﻿using ASmile.Com;
using ASmile.Com.RoleUser;
using ASmile.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASmile.Win.DaBLL
{
    class RoleUserBLL : BLLBase, IRoleUserBLL
    {
        protected override string ControllerName => "SysManage/RoleUser";

        [WebApi("SysManage/Role", "GetList")]
        public ApiResultList<Sys_Role> GetRoleData(string searchVal)
        {
            return GetResultList<Sys_Role>(new ArgPageData { SearchVal = searchVal });
        }

        /// <summary>
        /// 获取指定角色的所有员工
        /// </summary>
        public ApiResultList<VSys_RoleUser> GetRoleUsers(ArgRoleUserSearch arg)
        {
            return GetResultList<VSys_RoleUser>(arg);
        }
        /// <summary>
        /// 获取指定角色下的所有用户Id列表
        /// </summary>
        public ApiResultList<string> GetRoleUserIds(ArgRoleUserSearch arg)
        {
            return GetResultList<string>(arg);
        }

        public ApiResult AddUsers(ArgRoleUserAdd arg)
        {
            return GetResult(arg);
        }
        //public ApiResult AddUsers(string roleId, params string[] userIds)
        //{
        //    RoleUserAdd arg = new RoleUserAdd
        //    {
        //        RoleId = roleId,
        //        UserIds = userIds
        //    };
        //    return GetResult(arg);
        //}

        public ApiResult Remove(ArgId arg)
        {
            return GetResult(arg);
        }
    }
}